<template>
	<view class="activeDetail">
		<view class="detailBox" v-for="(item,index) in pageData">
			<view class="detailBox_top">
				<image src="../../static/image/qq.png" mode="" style="width: 48rpx;height: 48rpx;"></image>
				<view class="" style="margin-left: 30rpx;">
					课外活动
				</view>
			</view>


			<!-- Summer_Program -->
			<view v-if="item.type == 'SummerProgram'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.summer_start_time}}--{{item.summer_end_time}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.summer_program}}
					</view>
				</view>
				<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						比赛结果
					</view>
					<view class="value">
						{{item.summer_result}}
					</view>
				</view>
			</view>

			<!-- Competition -->
			<view v-if="item.type == 'Competition'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.competition_time}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.competition_type_name}}
					</view>
				</view>
				<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						比赛结果
					</view>
					<view class="value">
						{{item.competition_result}}
					</view>
				</view>
			</view>

			<!-- Research -->
			<view v-if="item.type == 'Research'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.research_start_time}}-{{item.research_end_time}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.research_name}}
					</view>
				</view>
				<!-- 	<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						比赛结果
					</view>
					<view class="value">
						{{item.result}}
					</view>
				</view> -->
				<view class="detailItemss" style="border-bottom: 0rpx;">
					<view class="lable">
						内容
					</view>
					<view class="value">
						{{item.research_content}}
					</view>
				</view>

			</view>


			<!-- Volunteer-->
			<view v-if="item.type == 'Volunteer'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.volunteer_start_time}}-{{item.volunteer_end_time}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.volunteer_name}}
					</view>
				</view>
				<!-- 	<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						比赛结果
					</view>
					<view class="value">
						{{item.result}}
					</view>
				</view> -->
				<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						职务
					</view>
					<view class="value">
						{{item.volunteer_duties}}
					</view>
				</view>
				<view class="detailItemss" style="border-bottom: 0rpx;">
					<view class="lable">
						内容
					</view>
					<view class="value">
						{{item.volunteer_content}}
					</view>
				</view>
			</view>


			<!-- Club-->
			<view v-if="item.type == 'Club'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.club_start_time}}-{{item.club_end_time}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.club_name}}
					</view>
				</view>
				<!-- 		<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						比赛结果
					</view>
					<view class="value">
						{{item.result}}
					</view>
				</view> -->
				<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						职务
					</view>
					<view class="value">
						{{item.club_duties}}
					</view>
				</view>
				<view class="detailItemss" style="border-bottom: 0rpx;">
					<view class="lable">
						内容
					</view>
					<view class="value">
						{{item.club_content}}
					</view>
				</view>
			</view>

			<!--Internship-->
			<view v-if="item.type == 'Internship'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.internship_start_time}}-{{item.internship_end_time}}
					</view>
				</view>
				<!-- <view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.name}}
					</view>
				</view> -->
				<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						公司名称
					</view>
					<view class="value">
						{{item.internship_name}}
					</view>
				</view>
				<view class="detailItem" style="border-bottom: 0rpx;">
					<view class="lable">
						职务
					</view>
					<view class="value">
						{{item.internship_duties}}
					</view>
				</view>
				<view class="detailItemss" style="border-bottom: 0rpx;">
					<view class="lable" style="width: 120rpx;">
						内容
					</view>
					<view class="value">
						{{item.internship_content}}
					</view>
				</view>
			</view>

			<!--Others-->
			<view v-if="item.type == 'Others'" class="detailMessage">
				<view class="detailItem">
					<view class="lable">
						活动类型
					</view>
					<view class="value">
						{{item.type}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动时间
					</view>
					<view class="value">
						{{item.others_start_time}}-{{item.others_end_time}}
					</view>
				</view>
				<view class="detailItem">
					<view class="lable">
						活动名称
					</view>
					<view class="value">
						{{item.others_name}}
					</view>
				</view>
				<view class="detailItemss" style="border-bottom: 0rpx;">
					<view class="lable">
						内容
					</view>
					<view class="value">
						{{item.others_content}}
					</view>
				</view>
			</view>

		</view>

		<view v-if="pageData.remark" class="remark-imgBox">
			<view v-if="pageData.remark" class="remark">
				{{pageData.remark}}
			</view>
			<view style="margin-top: 20rpx;display: flex;flex-wrap: wrap;">
				<image class="itemimg" v-for="(item,index) in pageData.remark_image" :src="item" mode=""
					@click="handleimgbig(pageData.remark_image)"></image>
			</view>

		</view>

	</view>
</template>

<script>
	import {
		userActivitydetails
	} from "@/api/api.js"
	export default {
		data() {
			return {
				pageId: "",
				pageData: {},
			}
		},
		onLoad(options) {
			this.pageId = options.id
			this.handleuserActivitydetails()
		},
		methods: {
			async handleuserActivitydetails() {
				let res = await userActivitydetails({
					id: this.pageId
				})
				this.pageData = res.data.data
				this.pageData.remark_image = this.pageData.remark_image.split(",")
				// console.log("课外活动", res)
			},
			handleimgbig(imgarr) {
				uni.previewImage({
					current: 0, // 当前显示图片的链接（必填）
					urls: imgarr, // 要预览的图片链接列表（必填）
					success() {
						// console.log('预览图片成功');
					},
					fail(err) {
						// console.log('预览图片失败', err);
					}
				});
			},
		}
	}
</script>
<style scoped lang="scss">
	.activeDetail {
		padding: 30rpx;
		box-sizing: border-box;

		.detailBox {
			width: 690rpx;
			// height: 466rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-bottom: 40rpx;

			.detailBox_top {
				width: 690rpx;
				height: 92rpx;
				background: linear-gradient(180deg, #E1E8FD 0%, #FEFEFF 100%);
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				display: flex;
				align-items: center;
				padding-left: 30rpx;
				box-sizing: border-box;
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				color: #255A9B;
				line-height: 32rpx;
			}

			.detailMessage {
				width: 100%;
				padding: 0 30rpx;
				box-sizing: border-box;

				.detailItem {
					display: flex;
					width: 100%;
					justify-content: space-between;
					border-bottom: 2rpx solid #F4F4F7;
					align-items: center;

					.lable {
						width: 120rpx;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #232832;
						line-height: 36rpx;
					}

					.value {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #9E9E9E;
						line-height: 92rpx;
					}
				}
				.detailItemss{
					width: 100%;
					border-bottom: 2rpx solid #F4F4F7;
					align-items: center;
					
					.lable {
						width: 120rpx;
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #232832;
						line-height: 36rpx;
					}
					
					.value {
						font-size: 28rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						color: #9E9E9E;
						line-height: 92rpx;
					}
				}
			}
		}

		.remark-imgBox {
			width: 690rpx;
			// height: 288rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-top: 30rpx;
			padding: 30rpx;
			box-sizing: border-box;

			.itemimg {
				width: 140rpx;
				height: 140rpx;
				border-radius: 10rpx;
				margin-right: 20rpx;
				margin-bottom: 10rpx;
			}

			.itemimg:nth-child(4n) {
				margin-right: 0rpx;
			}
		}
	}
</style>